package com.example.baserecyclerviewadapterdemo.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.example.baserecyclerviewadapterdemo.R;
import com.example.baserecyclerviewadapterdemo.entity.Status;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.List;

public class HeaderAndFooterAdapter extends BaseQuickAdapter<Status, BaseViewHolder> {
    public HeaderAndFooterAdapter(@Nullable List<Status> data) {
        super(R.layout.adapter_header_and_footer, data);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder holder, Status status) {
        switch (holder.getLayoutPosition() % 3) {
            case 0:
                holder.setImageResource(R.id.iv,R.mipmap.animation_img1);
                break;
            case 1:
                holder.setImageResource(R.id.iv,R.mipmap.animation_img2);
                break;
            case 2:
                holder.setImageResource(R.id.iv,R.mipmap.animation_img3);
                break;
            default:
                break;
        }
    }
}
